#include "SelectionStrategy.h"
#include "Chromosome.h"

void SelectionStrategy::resetTempData()
{
    return;
}

double SelectionStrategy::countTotalGenerationFitness(const QList<Chromosome*>& chromosomeList)
{
    double totalGenerationFitness = 0;

    for(int i=0;i<chromosomeList.size();++i)
        totalGenerationFitness += chromosomeList.at(i)->getFitness();

    return totalGenerationFitness;
}

double SelectionStrategy::countAverageGenerationFitness(const QList<Chromosome*>& chromosomeList)
{
    return countTotalGenerationFitness(chromosomeList)/chromosomeList.size();
}
